{template '_header'}
<style>
    .select2{
        margin:0;
        width:100%;
        height:34px;
        border-radius: 3px;
        border-color: rgb(229, 230, 231);
    }
    .select2 .select2-choice{
        height: 34px;
        line-height: 32px;
        border-radius: 3px;
        border-color: rgb(229, 230, 231);
    }
    .select2 .select2-choice .select2-arrow{
        background: #fff;
    }
    .form-group .radio-inline{
        padding-top: 0px;;
    }
</style>
<div style="margin-top: 50px"></div>
<form action="" method="post" class="form-horizontal form-search form-validate" id="myform">
    <h3>砍价活动设置</h3>
    <hr>

    <div class="form-group">
        <label class="col-sm-2 control-label">砍价活动参与榜</label>
        <div class="col-sm-9 col-xs-12">
            <label class="radio-inline">
                <input type="checkbox" name="bang_swi" value="1" aria-invalid="false" class="valid" onclick="check()" id="bang" {if $res['partin']>-10000}checked{/if}> 开启
            </label>
        </div>
    </div>

    <div class="form-group" id="partin" style="display: none">
        <label class="col-sm-2 control-label">砍掉多少可以上榜</label>
        <div class="col-sm-9 col-xs-12" style="width: 200px">
            <input type="number" name="money_limit" class="form-control" value="{$res['partin']}" placeholder="单位:元(含)" required>
        </div>
    </div>
    <script>
        check();
        function check() {
            var res = document.getElementById("bang").checked;
            if(res){
                document.getElementById("partin").style.display = "block";
            }else{
                document.getElementById("partin").style.display = "none";
            }
        }
    </script>

    <div class="form-group">
        <label class="col-sm-2 control-label">全局砍价规则设置</label>
        <div class="col-sm-9 col-xs-12">

            {php echo tpl_ueditor('rule',$res['rule']);}

        </div>
    </div>

    <div class="form-group">
        <div class="col-sm-9 col-xs-12" style="margin-left: 150px">
            <input type="submit" value="保存" class="btn btn-primary">
            <input type="hidden" name="token" value="{$_W['token']}"/>
        </div>
    </div>


</form>
</body>
{template '_footer'}